<?php


namespace tbf\Test;


class TbfEncodingTest extends \TbfTestCase{
    function testJsonDecode(){
        try {
            \TbfEncoding::JsonDecode("abc{");
            self::fail('here should have a exception');
        }catch(\Exception $e){
            self::assertSame($e->getMessage(),'json_decode fail Syntax error');
        }

        $this->assertSame(\TbfEncoding::JsonDecode('["abc"]'),array('abc'));
        $this->assertSame(\TbfEncoding::JsonDecode('"abc"'),'abc');
    }
} 